package com.job.controller;

import com.job.pojo.Info;
import com.job.pojo.Money;
import com.job.pojo.Offer;
import com.job.service.InfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;

@Controller
@RequestMapping("/info")
public class InfoController {
    @Autowired(required = false)
    InfoService infoService;

    //处理查询的ajax

    @RequestMapping("/selectAjax")
    @ResponseBody
    public HashMap<String,Object> select(Info info){
        return infoService.select(info);

    }


    //处理修改的ajax
    @RequestMapping("/updateAjax")
    @ResponseBody
    public HashMap<String,Object> updateMoney(Info info)
    {
        HashMap<String,Object> map = new HashMap<String,Object>();
        String in=infoService.update(info);
        map.put("info",in);
        return map;
    }

    //处理增加的ajax
    @RequestMapping("/addAjax")
    @ResponseBody
    public HashMap<String,Object>add(Info info)
    {
        HashMap<String,Object> map =new HashMap<>();
        String in=infoService.add(info);
        map.put("info",in);
        return map;
    }
    //处理删除的ajax
    @RequestMapping("/delAjax")
    @ResponseBody
    public HashMap<String,Object>delUser(Info info)
    {
        HashMap<String,Object> map =new HashMap<>();
        String in=infoService.del(info);
        map.put("info",in);
        return map;
    }

}
